package com.itheima.health.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.health.common.RedisConst;
import com.itheima.health.service.OrderSettingService;
import com.itheima.health.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.JedisPool;

import java.util.Iterator;
import java.util.Set;

/**
 * @author ：seanyang
 * @date ：Created in 2019/6/10
 * @description ：任务调度类,删除过期的预约信息
 * @version: 1.0
 */
@Service
public class ClearOrderSettingJob {
    @Reference
    private OrderSettingService orderSettingService;

    public void clearOrderSettingJob() {
        try {
           String today = DateUtils.parseDate2String(DateUtils.getToday());
            orderSettingService.deleteOrderSettingByDate(today);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
